package cn.singno.springBoot.demo.ch10_asyncTask;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class AsyncTaskService
{
	@Async
	public void executeAsyncTask(Integer i){
		try
                {
	                Thread.sleep(1000);
                } catch (InterruptedException e)
                {
	                
	                e.printStackTrace();
                }
		System.out.println("执行异步任务：" + i);
	}
	
	@Async
	public void executeAsyncTaskPlus(Integer i){
		System.out.println("执行异步任务+1：" + (1+i));
	}
}
